import React, { Component } from 'react';
import { connect } from 'dva';
import { Button } from 'antd';
import axios from 'axios';
import styles from './index.less';

const src = `https://bi.hichain.com/webroot/decision/view/report?viewlet=production/TMS/5.业务营运报表/5.5康宁/康宁统计报表_V1.0.cpt`
const topHeight = 69 + 24;

@connect(({ }) => ({}))
export default class WarningHK extends Component {
    state = {
        token: '',
    };

    componentDidMount() {
        // const { dispatch } = this.props;
        // dispatch({
        //     type: 'bireport/bireportSign',
        //     payload: reportName,
        //     callback: token => {
        //         this.setState({ token });
        //     },
        // });
        // const doc = document.querySelector('#test').contentDocument;
        // const docT = document.querySelector('#test').contentWindow;
        // const test = document.getElementById("test").contentWindow.document.getElementById("frozen-north");

    }

    render() {
        const { token } = this.state;
        return (
            <div className={styles.wrap}>
                <iframe
                    id="test"
                    width="100%"
                    frameBorder="no"
                    scrolling="no"
                    crossorigin="anonymous"
                    height={document.body.clientHeight - topHeight}
                    src={`${src}`}
                />
            </div>
        );
    }
}
